<div class="x-list-title">
<table width="100%" border="0" height="100%">
	<tr>
		<td align="left">
			<h2>Lịch cá nhân tuần</h2>
		</td>
		<td align="right">	
			<div class="x-list-options">	
				<a href="#Calendar/Index/Add" class="x-button">Lịch cá nhân mới</a>
				<a href="#Calendar/Company/Add" class="x-button">Lịch cơ quan mới</a>
			</div>
		</td>
	</tr>
</table>	
</div>
<div class="calendar-bar-container">
	<div class="calendar-bar">
		<?php $time = $this->get('time');?>
		<?php $pre_date  = date('\y\e\a\r=Y&\w\e\e\k=W',strtotime("-1 week",$time));?>
		<?php $next_date = date('\y\e\a\r=Y&\w\e\e\k=W',strtotime("+1 week",$time));?>
		<div class="calendar-ctr"><a href="#Calendar/Invite/Week?<?php _e($pre_date);?>" class="pre-calendar"></a>
		<a href="#Calendar/Invite/Week?<?php _e($next_date);?>" class="next-calendar"></a></div>
		  Tuần <?php _e(date("W",$time))?> tháng <?php _e(date("m",$time))?> năm <?php _e(date("Y",$time))?>
		<?php include "_Options.phtml";?>
	</div>
</div>
<table width="100%" class="x-list" cellpadding="0" cellspacing="0">
<?php foreach( $this->get('days') as $time => $posts ):?>
<tr>
<?php $is_current = date('d/m/Y',$time) == date('d/m/Y') ? ' week-current':''?>
<td class="calendar-week-day<?php _e($is_current)?>">
	<a href="#Calendar/Invite?date=<?php _e(date("Y-m-d",$time))?>"><?php _e(vn_day($time));?><br/>
	<small><?php _e(date("d-m",$time))?></small></a>
</td>	
<td valign="top">
	<?php foreach( $posts as $a ):?>
	<?php
		$tooltip ="<div class='x-toolbox'>
			<div class='event-quick-box'>
			<div style='border-bottom:1px solid #ddd;padding:0px 0px 5px 0px'>
			<big><b>{$a['title']}</b></big><br/>
			<i>$time</i><br/>
			</div><div style='padding:5px 0px'>
			".short_title(strip_tags($a['content']),300)."
			</div></div>
		</div>";	
	?>	
	<div class='calendar-post'>
		<a class='x-tooltip' href='#Calendar/Invite/View?ID=<?php _e($a['ID']);?>'>
			&#187; <?php _e(date("H:i",strtotime($a['time_start'])));?> - <?php _e(date("H:i",strtotime($a['time_end'])));?> <span style="color:#292929">  <?php _e($a['title']);?></span>
		<?php _e($tooltip);?>	
		</a>
	</div>
	<?php endforeach;?>
</td>	
</tr>
<?php endforeach;?>
</table>
